--*************ANIMATION SUITE****************--
--**************Property of Hxrmn*****************--
--*************Hxrmn@comcast.net*****************--
--DO NOT RE-DISTRIBUTE WITHOUT HXRMN'S CONSENT--
--********************************************--

PANEL = {}


surface.CreateFont( "Tahoma", 20,  700, false, false, "TrackFont2" )


function PANEL:ColorBrightness(color,amt)
	local nc = Color(math.Clamp(color.r+amt,0,255)
			,math.Clamp(color.g+amt,0,255)
			,math.Clamp(color.b+amt,0,255)
			,color.a)
	return nc
end

function PANEL:Init()
	self:SetSize(AS_KeyFrameWidth, 35)
	self.time = -1
	self.data = false
end

function PANEL:SetTime(t)
	self.time = t
end

function PANEL:GetTime()
	return self.time
end

function PANEL:DoClick()
	AS_GetAnimator():GetControls():GotoTime(self.time)
end

function PANEL:Paint()
	
	local color_text = Color( 255, 255, 255, 255 )
	local color_box  = Color( 80,80,80,255 )
		
		if(self.data) then
			color_box  = Color( 255,255,255,255 )
		end
		
		if(AS_GetAnimator():GetTime() == self.time) then
			color_box  = Color( 255,180,180,255 )
		end
		
		surface.SetDrawColor(color_box.r,color_box.g,color_box.b,color_box.a)
		surface.DrawRect(0,0,self:GetWide(),self:GetTall())
		
		color_box = self:ColorBrightness(color_box,-30)
		
		surface.SetDrawColor(0,0,0,255)
		surface.DrawOutlinedRect(0,0,self:GetWide(),self:GetTall())
		
		--draw.DrawText( text, "TrackFont2", 4, 8, color_text, TEXT_ALIGN_LEFT )

	return true
		
end


vgui.Register("vKeyFrame", PANEL, "Button")